#1
  1. No Profile Picture
    kong
    Guest
    Devshed Newbie (0 - 499 posts)
    Hello I would like to know whether it is possible to pass information between forms i.e. a persons name and company name.
    This is what I would like to do.
    I have a form which takes in a persons name and company name. Then that person proceeds to download files from my server on a different form. When that person downloads these files, I have a script that stores the name of the downloaded file. My problem is how do I also store the person's name with that file since the download page is on a different page?
    In a nutshell, how do I pass the information from one form to another and keep the users information consistent i.e. possibly store the info in a variable on the users computer?

    I know that this can be done using cookies but can php3 do this also?

    Thank You for your time. If you need more info please email me or post the message here.

    Raymond

  2. #2
  3. No Profile Picture
    rycamor
    Guest
    Devshed Newbie (0 - 499 posts)
    Of course, PHP can easily pass variables from one page to another.

    In fact, your first page doesn't even need to be a PHP page, just a standard form which submits the form variables to the receiving PHP page:

    <form METHOD="POST" ACTION="yourpage.php3" NAME="yourform">
    <input type="text" name="firstname">
    <input type="submit" name="Submit" value="Click Here to send this form">

    Thus "firstpage.html" would send the variable for "firstname" to yourpage.php3, where it could be read as $firstname.

    You could then from there make a secondary form going to yet another PHP page, and so on, if you wanted to.
  4. #3
  5. No Profile Picture
    kong
    Guest
    Devshed Newbie (0 - 499 posts)
    Thanks for the reply. I know that you can use PHP to process the values but I need the values to carry over to the next page.

    Here's how I have it set up right now. I have a form that submits these variables
    Name,Email,Subscribe to a perl script which does the following.
    print $query->redirect("http://www.mydomain.com/software/test.php3?Name=$S::Name?EMail=$T::EMail?Subscribe=$U::Subscribe");


    Here is part of the HTML code i have in test.php3.
    <INPUT TYPE="hidden" NAME="Name" VALUE="<?php echo $Name ?>">
    <INPUT TYPE="hidden" NAME="EMail" VALUE="<?php echo $EMail ?>">
    <INPUT TYPE="hidden" NAME="Subscribe" VALUE="<?php echo $Subscribe ?>">

    but it seems to store everything into Name. How do I pass it into their respective fields? I think that I might be using the echo function incorrectly to cut up the variables.

    Any help is appreciated. Thank You

  6. #4
  7. No Profile Picture
    PAV
    Guest
    Devshed Newbie (0 - 499 posts)
    When you do it the way rycamor described (form with METHOD=POST), you can actually use the submitted variables on the next page as values in the next form (the values are stored in $Name, $Email, $Subscribe). Just try it out.
    The other question about the Perl-syntax: on the url, multiple variables are concatenated with a "&", like: page.php3?var1=value&var2=value

    Peter
  8. #5
  9. No Profile Picture
    kong
    Guest
    Devshed Newbie (0 - 499 posts)
    Aaaah. It was the perl syntax that was wrong.
    It works fine now except that the variables show up in the url like so

    http://www.mydomain.net/test.php3?Name=JamesBond&EMail=007@bond.net&Subscribe=yes

    Is this in anyway a dangerous situation that I should worry about the variables showing up? Is there a fix?

    Thanks for all your help people.
  10. #6
  11. No Profile Picture
    PAV
    Guest
    Devshed Newbie (0 - 499 posts)
    I don't know what security level you want, but if you parse the variables through the form with METHOD=POST (without submitting through Perl and URL), at least the variables won't show up in the URL.

    Peter

Similar Threads

  1. Passing information throughout a site?
    By xxgeek in forum PHP Development
    Replies: 2
    Last Post: February 15th, 2004, 10:59 AM
  2. Passing string between forms
    By Anubus in forum Visual Basic Programming
    Replies: 22
    Last Post: January 26th, 2004, 04:40 AM
  3. Input Type=Image passing values in forms
    By mspokes in forum HTML Programming
    Replies: 0
    Last Post: January 6th, 2004, 09:28 AM
  4. Forms information
    By deathsythe in forum PHP Development
    Replies: 1
    Last Post: December 27th, 2003, 02:16 AM
  5. PHP forms Passing Variables Problem
    By rjharv in forum PHP Development
    Replies: 2
    Last Post: November 19th, 2003, 04:34 AM

IMN logo majestic logo threadwatch logo seochat tools logo