passing data accross multiple pages

This is a discussion on "passing data accross multiple pages" within the PHP Forum section. This forum, and the thread "passing data accross multiple pages are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 8th, 2007, 09:43
SuperMember

SuperMember
Join Date: Apr 2007
Location: Sydney
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
passing data accross multiple pages

Hi, Im currently building a directory type site. I have a registration procedure covering about 3 pages. What is the best way to pass data to the final page to be written to the database?

ideas currently are:

A cookie, although peolple may not trust cookies from an unknown site,

Write to the database at the start of each page, problems may occur if multiple people are registering at the same time,

or to create a temp file on the server for each new registration, no idea how to do this as yet..

Or I can pass the data through the pages in hidden text inputs..

I'm a bit out of my depth on this, but am doing it both as a commercial site, and to learn more about database driven websites.. any help, ideas or info on potential traps appreciated!

Nate.

Last edited by nate2099; Jul 8th, 2007 at 11:45.
Reply With Quote

  #2 (permalink)  
Old Jul 8th, 2007, 11:00
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,650
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: passing data accross multiple pages

Probubly a session/cookie but i dont know how to do them yet!
Reply With Quote
  #3 (permalink)  
Old Jul 8th, 2007, 15:26
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: passing data accross multiple pages

If you're using PHP then using a session is your best bet.

It's quite easy to use a session: At the top of each page that needs to access the data call the session_start function and use the following syntax to create and access variables in the session:

first page:

PHP: Select all

session_start();
$_SESSION['bla']=2;
$_SESSION['blub']="hello"
second page:
PHP: Select all

session_start();
$bla_value=$_SESSION['bla'];
$blub_value=$_SESSION['blub']; 
Now, if you write 'echo($bla_value); echo(" - "); echo($blub_value);' you would get the following output: "2 - hello".

Hope that works and hope you can understand that...
Check out this page on php.net for more info on using sessions.
Reply With Quote
Reply

Tags
passing data, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
405 error passing data from html to php nate2099 Starting Out 2 Apr 9th, 2007 22:18
passing search data to d/b via a hyperlink and without input fields Colm Osiris Databases 5 May 23rd, 2006 11:38
Passing session data tomd1985 PHP Forum 1 Mar 6th, 2006 18:13
Passing Data ... TheShadow Classic ASP 2 May 30th, 2005 09:31
Passing form variable between pages rhoov Classic ASP 8 Dec 16th, 2003 14:59


All times are GMT. The time now is 07:15.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43