Hi all,
I am getting really frustrated with storing and retreiving objects from a session. But it may be because of my lack of knowledge in sessions
First some system specs:
OS - Vista Home 32bit
Webserver - IIS 7
PHP - PHP 5.2.11
php.ini
session.auto_start = 1
So, when I decide to store an object array in the session, it works just fine. I can also retrieve it from the session but with an extra attribute mentioning: "__PHP_Incomplete_Class_Name" with the value of the Object Name.
Code when I try to retrieve object from session:
Code: $hits = $_SESSION['hitsArray']; // Array of MyObject
AMethodThatDoesSomething($hits[0]); // Requires MyObject Type
And this is where it fails:
I get following information in the debugger:
__PHP_Incomplete_Class_Name | MyObject
Attribute 1 | A value
Attribute 2 | Another Value
....And so on....
Ok, so I did some research and found out objects do not work if you have "session.auto_start = 1" in php.ini
AND that you need to add following line above your session_start():
Code:
require_once("MyObject.php");
session_start();
header("Cache-control: private");
session_register('hitsArray'); // Array of MyObject
$_SESSION['hitsArray'] = $hits; // Store into session
So, I changed "session.auto_start = 0" in php.ini and added the required line above. Well then it didn't even store my object array in the session in the first place!
Now I feel that I am stumbling in the dark and hope for someone to be able to help me in my ordeal!
Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I need to make it do user groups. See the groups are defined by numbers:0 - banned1 - registered2 -
php web service error
hey guys,I'm working on a project requires the use of web services. I've been trying a few tutorials and I get this one persistent error. I've search the web for clues, even this forum and nothing
need help in update query
hi i have a dynamic form. i need help in how can i use update query when values from dynamic form get pass to php file.currently when i press submit it displays this and does not update fieldsCode:
how to remove in php string display
My code is$message="We're looking at developing our website.";$body= "My message is,\n\n\n\n\t\t\t".$message";echo $body;I get result We\'re looking at developing our
selectbox+database connection retrive problem
Code: [Select] <tr> <th align="left" scope="col"><span class="style2 style8">Features
Trouble verifying database password
Thankyou to everyone who responded to my last post (I can't find the posting, it has been buried). I am currently making a login form and the associated php code. It all seems to work apart from the
IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:Code: $query = "SELECT * FROM film UNION ALL SELECT * FROM people ORDER BY id DESC LIMIT 5 ";Now each of those tables,
Multiple PHP errors when clicking a link..and..removing a ghost..
Hi - I have 2 problems with a new website - homeswapvacations.com, which I need help solving.The first problem - In the left column (on all pages) is "Featured Listing" column (in the admin
values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a database. the form submits some data to one table, and other data to another table. my problem is that
Variables and Include
Code: [Select]<?php$header = $_COOKIE['mss']['header'];$body = $_COOKIE['mss']['body'];$footer = $_COOKIE['mss']['footer'];include '$header';include '$body';include '$footer';?>The