|
-
Mar 19th, 2004, 01:40 PM
#1
Thread Starter
Frenzied Member
sending array to next page
I need to send an array from one page to another. I don't use any forms, but I could if I need to and I don't want to use MySQL.
Should I use cookies? I want something that the user can't edit (obviously 'll encrypt the data)
It's not extremely important data, it's sorta like a quiz.
Have I helped you? Please Rate my posts. 
-
Mar 19th, 2004, 02:17 PM
#2
Frenzied Member
Use a form with the POST method. All your data will get passed to the next page and the user won't see it in the URL.
-
Mar 19th, 2004, 02:31 PM
#3
Thread Starter
Frenzied Member
But Then I have to use a hidden form. If they are clever enough, they can edit this.
If this is by far the easiest method I'll do it anyway, I'll just come up with a nifty encryption for it.
Have I helped you? Please Rate my posts. 
-
Mar 20th, 2004, 12:09 AM
#4
Stuck in the 80s
Depending on the data, you can use sessions. If I was doing it, I'd probably use a database, but you said no to that.
-
Mar 27th, 2004, 01:10 AM
#5
Lively Member
How about working off a txt file kept on the server ?
Ony thing is if the user finds out the name of the file, they will have access to the info. I guess you could even name the file with the session ID to make it alittle harder. I dont really see how they could find the txt files name unless they scan your sites dirs with an exturnal app, but who knows 
Just some thouhgts.
~ What was once an opinion, became a fact, to be later proven wrong... ~
-
Mar 27th, 2004, 05:05 AM
#6
Thread Starter
Frenzied Member
How do you create, read, delete and rename files?
Have I helped you? Please Rate my posts. 
-
Mar 27th, 2004, 05:50 AM
#7
Lively Member
Heres acouple functions that you can play with... you'll have to edit them to fit your needs.
PHP Code:
function create_file($the_file){
global $bla;
$file = fopen ($the_file, "w");
fclose($file);
return $the_file . " Created" ;
}
function create_file_with_info($the_file, $the_txt){
global $bla;
$file = fopen ($the_file, "w");
$fw = fwrite($file, $the_txt);
fclose($file);
return $the_file . " Created with info:<br>" . $the_txt ;
}
function read_file($the_file){
global $bla;
@chmod($the_file, 0777);
$lines = file($the_file);
foreach ($lines as $line_num => $line) {
$edited_txt = $edited_txt . $line ;
}
return $edited_txt ;
}
function save_file($the_file, $the_txt){
global $bla;
$fp = fopen($the_file, "w");
fwrite($fp, $the_txt);
fclose($fp);
@chmod($the_file, 0755);
return $the_file . " Saved with info:<br>" . $the_txt ;
}
function rename_file($the_file, $new_name){
global $bla;
rename($the_file, $new_name);
return "<b>Old Name</b> " . $the_file . "<br><b>New Name</b>" . $new_name ;
}
function delete_file($the_file){
global $bla;
unlink($the_file);
return "Gone, <b>R.I.P</b> " . $the_file ;
}
For more info:
http://us2.php.net/manual/en/function.file.php
Never used it but you might want to look into this too:
http://us2.php.net/manual/en/functio...e-ini-file.php
~ What was once an opinion, became a fact, to be later proven wrong... ~
-
Mar 27th, 2004, 11:25 AM
#8
Stuck in the 80s
What's up with all the:
In there? That doesn't make sense to me. It's not used.
-
Mar 27th, 2004, 05:01 PM
#9
Lively Member
Originally posted by The Hobo
That doesn't make sense to me. It's not used.
Most of the code i posted was from a script of mine.. I had some more code in there where i was using them to hold an array... i just did a copy/paste with alitte editing.. I should have left out the gloables in what i posted here
~ What was once an opinion, became a fact, to be later proven wrong... ~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|