Re: how to get object in pages !!!



some files are included in my php script, and in one of those files
session.start() method is being called so, I don't need to call this
function again. for testing purposes I am doing the following:
this is content of test1.php (page is submitted to itself)

<html>
<form action="test1.php">
<?php
if($_SESSION['list']) {
$output = $_SESSION['list'];
echo "value of output is $output";
}
else {
$final_list = someVariable->someJavaFunction('some Arguments');
//this function returns a java ArrayList
echo "setting the value in session : $final_list";
$_SESSION['list'] = $final_list;
}
?>

<html code for submit button>

</form>

when I submit this form it always prints :
setting the value in session : (contents of ArrayList object)

it never goes into if clause, whereas it should have gone into if
clause because I have set the session. it never prints :
value of output is (contents of ArrayList object)

.


Quantcast