SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Nov 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK,

    I can get my data into the database from a form and even edit my database info. What I'm looking to do, now, is to setup an intermediate page where the submitted info is displayed to the person entering the info. The submitter can then go back to the form entry to edit their submission or click an OK button to add it to the database.

    What is the best way to get the data from the data entry screen to the verification screen, then on to the actual database insert function?

    Mark-

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Using the forms post method automatically forwards the data from the form to the next PHP page. All you have to do is reference each form field with is PHP equivalent (i.e. name = $name).
    Wayne Luke
    ------------


  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use different names for the submit buttons (submit1, submit2, etc), and determine which was pressed like this:

    Code:
    if (isset($submit1) && !isset($submit2) && !isset($submit3)) {
    do stuff
    }
    If you've determined that the've entered their info and it is to be previewed, simply store it in hidden HTML form fields inside the FORM tag:

    Code:
    <input type="hidden" name="email" value="<?php echo("$email"); ?>">
    Hope that helps a bit.


  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dang, Wayne just beat me. He, however, still needs to be able to submit the information via the button, so in that case the hidden form fields would probably be the way to go. I could be mis-reading him, but I think that's what he means.

    If I'm wrong, let me know!

  5. #5
    SitePoint Member
    Join Date
    Nov 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK that's prettymuch what I thought. So, to keep it simple, I should just add an intermediate page that has the input results visible AND hidden form fields holding them that then submits to the final processing page.

    I was hoping there was a simpler way to do it, but it should only take a half hour or so per form...

    Thanks!

    Mark-

  6. #6
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, not terribly convienent, but the only way I know how, and I'd imagine it's the most commonly used. Good luck with your work!

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you haven't started yet, you could probably do a simple display and simple hidden input using while loops in about 6 lines of code.

    while(list($key,$val) = each ($HTTP_POST_VARS)) {
    if($key != "submit") {
    print $key ." = ". $val."<br>";
    printf('<input type="hidden" name="%s" value="%s">', $key, $val);
    }
    }
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  8. #8
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Duh - I should've thought of that. Very nice work Freddy - in my book, you're Mr. Efficiency. Slogan? "There's always a better way!"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •