Jump to content

[SOLVED] session help


sfx81

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.