RE: PHP Sessions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



rory walsh <mailto:rorywalsh@xxxxxx>
    on Wednesday, March 02, 2005 2:38 PM said:

> Is it to do with the link:
> <a href=\"index.php?action=edit\">
> does this call the script again, just as an action="script.php" in a
> form would? Cheers for the help on this.

Yes it does. But it doesn't erase the session values (it seems that's
what you think is happening?).

I think what you need to do (I do this sometimes too) is start from
scratch and create a very basic test page that works as expected. Then
slowly add in the features you want. It'll give you a much greater
understanding of how things work and where you're going wrong. Sure it's
tedious but it'll help you in the long run.

Here is a good base to start with:

<?php

	session_start();

	if(isset($_GET['var']) && !empty($_GET['var']))
	{
		$_SESSION['myVariable'] = "from form";
	}
	else
	{
		$_SESSION['myVariable'] = "direct request";
	}

	print_r($_SESSION);

?>


hth,
Chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux