hi
I am a newbie,I can't understand this behavior here.
When first time I load this code......I get everything right.
WHAT I AM TRYING TO DO IS:-
I have put serialized instance of a object in session in page 1.php
1.PHP
$gdata = new srch_args();
$args_string = serialize($gdata);
$_SESSION['args'] = $args_string;
Now in this page I am trying to access that object unserializing it.I get it right for the first time I load it......but if I refresh the page i end up with errors.
2.PHP
$data = new srch_args();
$data_string = "";
echo $_SESSION['args'] . "<br>";
$data_string = $_SESSION['args'];
$data = unserialize($data_string);
echo $_SESSION['args'] . "<br>";
I get this output as expected:
O:9:"srch_args":7:{s:10:"consultant";s:27:"puskur:rao:raopuskar:partha";s:6:"client";s:6:"AECTRA";s:8:"end_date";s:0:"";s:10:"start_date";s:0:"";s:14:"billing_status";s:0:"";s:9:"reference";s:7:"Testing";s:4:"stat";s:0:"";}
O:9:"srch_args":7:{s:10:"consultant";s:27:"puskur:rao:raopuskar:partha";s:6:"client";s:6:"AECTRA";s:8:"end_date";s:0:"";s:10:"start_date";s:0:"";s:14:"billing_status";s:0:"";s:9:"reference";s:7:"Testing";s:4:"stat";s:0:"";}
BUT WHEN I REFRESH THE PAGE I END UP WITH ERRORS SOME THING LIKE THIS:
&WHERE=get&Client=AECTRA&Start_Date=&End_Date=&bill=&consult=puskur:rao:raopuskar:partha&Billing_Status=&Reference=Testing
Notice: unserialize() failed at offset 0 of 122 bytes in C:\Program Files\Apache Group\Apache2\htdocs\test\getdata1.php on line 60
&WHERE=get&Client=AECTRA&Start_Date=&End_Date=&bill=&consult=puskur:rao:raopuskar:partha&Billing_Status=&Reference=Testing
Fatal error: Call to a member function on a non-object in C:\Program Files\Apache Group\Apache2\htdocs\test\getdata1.php on line 64
CAN SOME BODY TELL WHAT IS GOING ON IN HERE.................PLEASE
THANKS IN ADVANCE