Reply to Session problem

Your name:

Reply:


Posted by leo on 07/23/07 16:05

Hi , i have a problem with session variables.
The web site was already working correctly using sessions, i've had to
add a page which use a new variable session but this new one doesn't
get registered, so when the page redirect to another one the new
variable is vanished.
Here a snippet of the code:

<?php

unset($_SESSION['tipopreventivo']);

//debug
$hand=fopen("public/test.txt","w");
fwrite($hand,print_r($_POST,true));
fclose($hand);
//

if(!empty($_POST))
{
$error=array();
session_register('typep');
$_SESSION['type']=($_POST['type']?$_POST['type']:'Default');

//debug
$hand=fopen("public/session.txt","w");
fwrite($hand,print_r($_SESSION,true));
fclose($hand);
//

if($_POST['info']==1)
{
$url="Location: prev.php";
header($url);
}

}


after submit text.txt e session.txt are right, in particular in
session.txt the variable $_SESSION['type'] is set ad has a value but
after the redirect to prev.php $_SESSION['type'] is not set
The sessions are working becouse other variables are passed correctly.
Any idea of what is wrong?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация