View Full Version : storing form data without a database
ryry1283
02-01-2005, 02:37 PM
I want to make a form that will store form data that I can use on another PHP page without using a MySQL database. I want to pass it over a few pages. Can I do this? If so, how?
By the way, all I really need to pass is a string of text. I wasn't sure if this mattered, so I included it.
All help is needed and appreciated.
Ryan K. Ariff.
Viper007Bond
02-01-2005, 04:23 PM
You could POST it from one page to the next.
SnakEyez
02-01-2005, 04:27 PM
If it has to be passed over many pages then the best method would be to use sessions. That means for the form processing you would have to make $_POST['string'] = $_SESSION['string']. And you would have to put the session_start(); line on every page it gets carried to. Then when you want to delete it just do session_destroy().
If you only need it on one page just use the $_POST['string'] to call out the variable. And keep in mind that I am using the post method for the form. If you are using the GET method it just changes to $_GET['string'].
Viper007Bond
02-01-2005, 04:32 PM
Er, yeah, I'm retarded/half-awake. Use sessions for mutliple pages.
And I'd use POST over GET as GET is much easier to abuse as it's in the URL. Then again, GET is a lot easier to code.
SnakEyez
02-01-2005, 06:25 PM
Er, yeah, I'm retarded/half-awake. Use sessions for mutliple pages.
And I'd use POST over GET as GET is much easier to abuse as it's in the URL. Then again, GET is a lot easier to code.
True, but if you want to make it secure with GET you can pass extra variables through the page, and you could always use $_SERVER['REQUEST_URI'] to make sure the page they were at last was the page where the data was entered.
RammsteinNicCag
02-01-2005, 10:45 PM
you could always use $_SERVER['REQUEST_URI'] to make sure the page they were at last was the page where the data was entered.
Don't some firewalls allow you to block referrers?
Jennifer
Viper007Bond
02-02-2005, 02:38 AM
Browsers even. I have a web developer extension for Firefox that'll allow me to do that kinda thing.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.