PHP Array Storage

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
bonkers
New php-forum User
New php-forum User
Posts: 46
Joined: Wed Mar 12, 2003 7:17 pm

PHP Array Storage

Post by bonkers » Mon Jun 02, 2003 11:35 pm

How can I do this:

when the script is run, it stores the information it recieves in from the arguments in an array.

it encrypts the array.

it writes the array to a file.


When another script is run it does this:

reads the file,

unencrypts the array,

it displays the data.

User avatar
WiZARD
Moderator
Moderator
Posts: 1256
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: PHP Array Storage

Post by WiZARD » Tue Jun 03, 2003 2:39 am

> when the script is run, it stores the information it recieves in > from the arguments in an array.
$arr_var = array(vr_01 =>($var01), vr_02 =>($var02) etc);
$arr_var = array(vr_01, vr_02 etc);
see array in manual.....
http://www.php.net/array

> it encrypts the array.
for what?

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Post by mike » Tue Jun 03, 2003 3:04 am

You cannot encrypt an "array" only a "string". Check on manual what the difference is.

User avatar
WiZARD
Moderator
Moderator
Posts: 1256
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Post by WiZARD » Tue Jun 03, 2003 5:13 am

mike wrote:You cannot encrypt an "array" only a "string". Check on manual what the difference is.

as i understand his want to create personall wasswd file :D

bonkers
New php-forum User
New php-forum User
Posts: 46
Joined: Wed Mar 12, 2003 7:17 pm

Post by bonkers » Tue Jun 03, 2003 6:07 pm

No actually... I kinda wanted to do like this, it's for a posting thing.

text file as follows:

Code: Select all

poll 1 (wow)
-question 1: 60  //60 is the number of votes
-question 2: 50
-question 3: 134
-question 4: 214

poll2 (who)
-question 1: 13
-question 2: 1324234
-question 3: 1344
-question 4: 9834


This text file doesn't have to be encrypted, it's pretty much just for storing data from polls... they're not really questions but rather voting options.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests