Jump to content

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


fletchsod

Recommended Posts

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
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

[!--quoteo(post=374753:date=May 17 2006, 01:49 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 17 2006, 01:49 PM) [snapback]374753[/snapback][/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).
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

[!--quoteo(post=374803:date=May 17 2006, 05:25 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 17 2006, 05:25 PM) [snapback]374803[/snapback][/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\" /]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.