PHP Array Storage

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

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: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

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?
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

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

Tue Jun 03, 2003 3:04 am

You cannot encrypt an "array" only a "string". Check on manual what the difference is.
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

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

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
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

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

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