Jump to content


Photo

Data transfer


  • Please log in to reply
6 replies to this topic

#1 nisroc

nisroc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 12 August 2006 - 01:42 AM

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.

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 August 2006 - 01:43 AM

what type of data?  You can use the url to pass parameters, sessions...any number of ways.

#3 nisroc

nisroc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 12 August 2006 - 01:53 AM

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.

#4 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 August 2006 - 01:57 AM

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?

#5 raza.shahzad

raza.shahzad
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 12 August 2006 - 02:05 AM

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.

#6 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 12 August 2006 - 02:13 AM

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.
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#7 nisroc

nisroc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 12 August 2006 - 03:42 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users