Jump to content

Sending variables accross files?


shoopaie

Recommended Posts

To make this as basic and understandable as I can, how do i take a handful of variables (created FROM a form) and send them to another file that has collected other variables from a second form, so that I can email them all at the same time, instead of two different emails.

 

So basically is i have $fn, $ln, $phone, $email, stored from one form, and $ftp_un, $ftp_pw, etc from another form, how do i collect them all into one file to be processed? Thanks for the help.

 

I am thinking in my head there should be a way to take the variables from form1.html, and form2.html, and have them all processed in form_process.php, then on to be emailed.

 

I remember studying some "constants" and "global variables" but nothing that is ringing a bell. Is constants, or global variables, or custom functions accessible to a file that isn't their source file? I cannot include the file or else i include alot of extra fluff...

Edited by Adam
Link to comment
Share on other sites

I think you have two ways to approach this:

 

-- User enters data in the first form. Form submits, PHP is used to process the data (using $_POST[]) and it is stored in hidden inputs within a second form. User submits the second form, and then PHP is used to retrieve the from data, which includes hidden fields from form #1 and visible form fields from form #2.

 

-- You could also use sessions, and save form fields within variables in the session like Rudyten said above.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...