Jump to content


Photo

*SOLVED* How to store data in RAM (1st webpage) then retrieve data from RAM (other webpages)??


  • Please log in to reply
4 replies to this topic

#1 fletchsod

fletchsod
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 17 May 2006 - 06:36 PM

Hi fellas!!

I'm a little bit frustrated because I found no information on the Internet to help me out. What I need is a way to store the PHP array data into the RAM memory and come back to retreive it at a later time. A lot like the C/C++ language... Like 1st web page, store it there then any other web pages, retrieve it. This can be done by saving the known memory address for later use.

I can not use the PHP's session because it store the data to a temporary file on the hard disk because it would have been illegal to do so. (It's because of the law - Fair Credit Reporting Act and of the agreement we made with Equifax, Experian and Trans Union). But we're allow to store them in the RAM because the information is permamently stored there and it seem that nothing can retrieve it by a non-php process. I can't use the database either.

What do I need to do?

Thanks,
FletchSOD

#2 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 17 May 2006 - 06:49 PM

Ram is not permanent especially if the server goes down or has to be rebooted.

I'm sure they'd allow you to use sessions (disked base solution) if you have the data encrypted.

See:

[a href=\"http://us2.php.net/manual/en/ref.sem.php\" target=\"_blank\"]http://us2.php.net/manual/en/ref.sem.php[/a] (not available for Windows)

[a href=\"http://us2.php.net/manual/en/ref.shmop.php\" target=\"_blank\"]http://us2.php.net/manual/en/ref.shmop.php[/a]

#3 fletchsod

fletchsod
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 17 May 2006 - 09:46 PM

[!--quoteo(post=374753:date=May 17 2006, 01:49 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 17 2006, 01:49 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Ram is not permanent especially if the server goes down or has to be rebooted.

I'm sure they'd allow you to use sessions (disked base solution) if you have the data encrypted.

See:

[a href=\"http://us2.php.net/manual/en/ref.sem.php\" target=\"_blank\"]http://us2.php.net/manual/en/ref.sem.php[/a] (not available for Windows)

[a href=\"http://us2.php.net/manual/en/ref.shmop.php\" target=\"_blank\"]http://us2.php.net/manual/en/ref.shmop.php[/a]
[/quote]

THe data does not need to be permament. It's only as good as the 15 minutes idle-timeout. Yea, I can use the session but it can not store the data to the disk at all. Encrypted or not, storing bytes to the disk would be a violation anyway.

I just recently found some information. Took me a while to understand the confusion due to lack of documentation.

A link to Zend's website at "http://www.zend.com/zend/tut/session.php#storage" and look under the "Storage Modules" section halfway down on the webpage.

Again, I got this info from "http://www.onlamp.com/pub/a/php/2001/04/26/sessions.html" under the configuration section that explain it in more detail.

So, that got me thinking and I spend some time searching at php.net website for answers and it wasn't until I found one at "http://www.php.net/manual/en/ref.session.php" under the "Installation" section that I overlooked. Kind of hard to read but very easy to overlook when searching in vain for some answer.

I'm glad I finally found something that can be of a use. I would like to go with the PHP's Session feature instead of the 3 parts, "Semaphore, Shared Memory and IPC Functions"... Not that I don't want to use those three parts but I'm afraid it would be a pain to write a script because it is all new to me and act like I'm crossing my finger hoping for the best and that nothing goes wrong in the long run.

For one of you who are interesting in learning how to accomplish that (PHP's Session) then a good documenation for compiling one (How-To) is at "http://www.zend.com/tips/tips.php?id=164&single=1" I just discover it from Google Search while looking for more information about Session and Shared Memory not related to this web link.

I'm thinking of going to file a PHP bug to get somebody to update the PHP's Session documentation becuase it's not a well and clear documentation.

Thanks for all of your time and suggestion. I appreciated it...

Edited: PHP Bug #37484 (Sorry if my comments there is sloppy 'cuase it's all I think of).


#4 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 17 May 2006 - 10:25 PM

Oh, yeah cool. I completely forgot about memory based session support in PHP (under Unix/Linux). I've used the "user" option to write sessions to MySQL instead of PHP flat files. But you're the first I've heard of needing memory based.

Good luck and happy coding.



#5 fletchsod

fletchsod
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 18 May 2006 - 01:52 PM

[!--quoteo(post=374803:date=May 17 2006, 05:25 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 17 2006, 05:25 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Oh, yeah cool. I completely forgot about memory based session support in PHP (under Unix/Linux). I've used the "user" option to write sessions to MySQL instead of PHP flat files. But you're the first I've heard of needing memory based.

Good luck and happy coding.
[/quote]

Yea, I'm using AIX on this one... By the way, it's all new to me but I did read recently that the memory based session is already built-in by default for Windows while it's not by default for Unix/Linux. Weird. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users