about sessions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

about sessions

Post by bugthefixer »

i have used sessions in my site
when a user from the current page clicks 'back' then the previous pge does not display rather it says refresh the page..
how can i get rid of this problem
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

this generally happens when you have post data being passed. Switching those to get calls will, generally, fix them. However, the url will get funky looking..
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

about post and get

Post by bugthefixer »

i know its not relevant to this forum but can u please tell me whats the difference between get and post.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

get values are passed in the url: www.foo.com/index.php?foo=bar&foo2=12
whereas post values are sent in the HTTP request header passed by the browser. So the url would remain www.foo.com/index.php

to see the get/post variables passed to your page(s):

Code: Select all

<?php
print_r($_GET); // write all the stuff in get variables
print_r($_POST); // write all the stuff in the post variables
?>
to access the get variables from the first example:

Code: Select all

<?php

if(isset($_GET['foo']))
{
  echo $_GET['foo']."\n";
}

if(isset($_GET['foo2']))
{
  echo $_GET['foo2']."\n";
}

?>
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

theres a tutorial in the 'Wiki' section

Passing vars via $_GET & $_POST, read it.

:wink:
Zooter
Forum Commoner
Posts: 45
Joined: Tue May 18, 2004 10:46 am
Location: South Africa

Post by Zooter »

Doesn't it have something to do with the caching of web pages?
zenabi
Forum Commoner
Posts: 84
Joined: Mon Sep 08, 2003 5:26 am
Location: UK

Post by zenabi »

tim wrote:theres a tutorial in the 'Wiki' section
Just curious, what's the 'Wiki' section?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

http://wiki.devnetwork.net/

It's in the navigation of this site, at the very top of this page - a small link called "Wiki".

Regarding your original problem: check the manual on [php_man]header[/php_man], look at no caching.
Post Reply