nisroc Posted August 12, 2006 Share Posted August 12, 2006 Is it possible to transfer data from one page to another without the need of a database using php? If so can someone point me to an example. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 12, 2006 Share Posted August 12, 2006 what type of data? You can use the url to pass parameters, sessions...any number of ways. Quote Link to comment Share on other sites More sharing options...
nisroc Posted August 12, 2006 Author Share Posted August 12, 2006 form data is what i need. i was thinking a session, but i think that is a bit advanced for me however im gonna try it anyway. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 12, 2006 Share Posted August 12, 2006 If it is a small amount of data, pass it in the url to the next page, then use $_GET to retrieve it. If it's a large amount of data, why are you passing it from page to page? Why not include the second page in the first (or just make one page)?What are you trying to accomplish by passing the data from page to page? Quote Link to comment Share on other sites More sharing options...
raza.shahzad Posted August 12, 2006 Share Posted August 12, 2006 dear friend,many people use the word database for mysql, oracle etc. if you take the meanings of database as the same you can store the form data in a file say data.txt and then retrieve the data into another file using some simple functions. you can ask for more from here if you wish to use files. no matter how huge the amount of data is you can do it this way. Quote Link to comment Share on other sites More sharing options...
Buyocat Posted August 12, 2006 Share Posted August 12, 2006 If you want to pass form data across multiple pages -- say you have a multipage form -- then there are really only two ways I would do it. One with sessions, which I suppose we've ruled out. The second is to store the data from page one in hidden fields on page two. I think it is pretty clear how this would work. When the user requests the second page of the form your script would check for post data from the first page and then screen it; it would report any errors and if none were found it would set the form data to hidden fields. Then when the user submits the second form you could just scan all of the information once more.You may not need to raise errors if the user leaves fields blank or something on the first page, but you'll want to check for some things most likely, and you'll want to escape the data. Quote Link to comment Share on other sites More sharing options...
nisroc Posted August 12, 2006 Author Share Posted August 12, 2006 What i am actully doing here is reating a test. The test results and answers are stored in a database along with the user, ip, date, and score. Now once the test is submitted it will called their score from the database and display it on page two. The problem is I need to store a user name so that i can update records and not hagve them mixed up with someone elses. This is big group only 25 users will be using this forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.