Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Simple Question

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Simple Question

Postby phpnewbie34 » Fri Apr 26, 2013 11:26 am

I can send information from one page to another $_POST

But how do I send information from a form from the second to the third page?

Do I use a cookie or can I use a simpler method?

Thanks
phpnewbie34
New php-forum User
New php-forum User
 
Posts: 14
Joined: Mon Apr 22, 2013 4:00 am

Re: Simple Question

Postby johnj » Fri Apr 26, 2013 6:57 pm

You can use a hidden form variable.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Postby HussainMHB » Sat Apr 27, 2013 9:21 am

I think session'd be help you but i'm not quite sure
HussainMHB
New php-forum User
New php-forum User
 
Posts: 10
Joined: Sat Apr 13, 2013 2:53 am

Re: Simple Question

Postby phpnewbie34 » Sat Apr 27, 2013 3:27 pm

How do you return variables from the $_SESSION variable??
phpnewbie34
New php-forum User
New php-forum User
 
Posts: 14
Joined: Mon Apr 22, 2013 4:00 am

Re: Simple Question

Postby johnj » Sun Apr 28, 2013 1:57 am

johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Simple Question

Postby swarups » Sun Apr 28, 2013 9:32 pm

Hi,

I could not able to spot your exact requirement.

But I am sure either form with hidden fields or session variables will help you.


Thanks
Swarup
swarups
New php-forum User
New php-forum User
 
Posts: 20
Joined: Tue Mar 06, 2012 11:05 pm

Re: Simple Question

Postby LordMatt » Tue Apr 30, 2013 4:26 pm

There are three main approaches used to solve this problem.

The first is to use hidden form elements

Code: Select all
<input type="hidden" name="bob" value="My Value"/>


This works well for simple issues like if you are simply breaking the form into a few smaller pages for an easier UI for the user.

However this also means that if the browser crashes all data is lost.So the second approach is to place the data into the session. This keeps the data alive a bit longer and with say a login script the information does not need to be entered every time.

If the browser is closed the session can die and the data can be lost.

The third approach is to make the user register and log in and to use sessions to track the user ID. In this way data is saved to a database each time the form is submitted. Users can leave the form process half done and come back later to finish.
User avatar
LordMatt
New php-forum User
New php-forum User
 
Posts: 7
Joined: Tue Apr 30, 2013 4:16 pm
Location: UK

Re: Simple Question

Postby Nicknnick » Tue Apr 30, 2013 4:39 pm

Thanks LordMatt, I am also thinking for session to track user id..!
Nicknnick
New php-forum User
New php-forum User
 
Posts: 8
Joined: Tue Apr 30, 2013 3:31 pm

Re: Simple Question

Postby phpnewbie34 » Tue Apr 30, 2013 4:41 pm

Thanks. Problem solved. :)
phpnewbie34
New php-forum User
New php-forum User
 
Posts: 14
Joined: Mon Apr 22, 2013 4:00 am


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.