Jump to content

Pass form data to another form using array


ultrasound0000

Recommended Posts

Hi,

 

I need to pass form data from one form to another, different pages.  The form has about 6 fields (i.e. first name, last name, etc).  What is the best way to do this in PHP?  I was thinking maybe put all the form values into an array and then pass them over to the next page?

 

The trick is that I can use php for the first site/page, but not for the second (since that site does not have PHP installed). 

 

So this might have to be done via URL variables also, but I'm concerned about security.

 

Any suggestions and examples would be greatly appreciated. 

 

 

Link to comment
Share on other sites

You need to use session_start() at the top of any page that uses sessions.

 

This is a very basic example. Thi

 

<?php
session_start();

$_SESSION['value1'] = $_POST['form_value'];
?>

 

and if you want to echo the session you just

echo $_SESSION['value1];

 

is there any reason why the other form is php supported?

Link to comment
Share on other sites

following are the methods of transferring data between 2 pages of different sites

 

- GET - send all variables in URL

- POST - submit the form to the second page.

 

These methods work irrespective of languages used for both pages. Languages will come into picture to READ variablesi n the second page of assing values to FORM variables before submit in first page.

 

- Session will not work in this case as the 2 pages are in different sites and hence different domains.

 

hope i make some sense.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.