1

Am having three forms, I need to post values from form 1 to form2 and again combine form 1 and form 2 i want to post the value to form 3.

Form 1 and Form 2 having array of values..

I can able to receive array of values from form 1 to form 2. but not able to POST that form 1 and form 2 array of value to form 3.

Am working on PHP.

Kindly suggest me.

4
  • 3
    You could save form 1 / 2 in $_SESSION variables, or as hidden form (form 1 in form 2, form 1 and 2 in form 3) elements, or ... (any other options) Commented Apr 23, 2014 at 4:30
  • 3
    Why don't you use sessions? Commented Apr 23, 2014 at 4:30
  • 2
    SESSION would be better, posted values will appear in page source on form2 which isn't secure. Commented Apr 23, 2014 at 4:31
  • Yes, I use hidden text field to pass array of values from form 1 to form 2. But again from 2 to form 3 i need to pass array of value from form 1 and array of value from form 2 to form 3. --- But form 1 having 30 fields and form 2 having 30 fields.. So receiving form 1 value to form 2 is achieved. Again I need to pass form 1 array of value to form 3 - Am stuck here. Commented Apr 23, 2014 at 5:43

2 Answers 2

1

You Can use the Hidden fields . First form $_POST value to be the second value Hidden field. After You submit the second form You Get both form 1 and form 2 Data's

Or Use Session also a good Approach

Sign up to request clarification or add additional context in comments.

Comments

1

Use session or hidden fields but using session would be better let me explain

using Hidden :-

Form1:- data submitted/posted on form 2 :- get post values in hidden on your second form

Form 2:- all form 2 input fields+ form1 hidden fields and post to form 3

Get all posted values of form1 and 2 on form 3

**Using Session**

Form1:- data submitted :- make a session and store all values of form1 in session

Form 2:- data submitted :- make a session and store all values of form1 in session

Form 3:- Retrieve values of sessions of form1 and form2

1 Comment

thanks I used the session to store the value and post to post the content

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.