Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Apr 2005
    Location
    Hatfield, England
    Posts
    855
    Member #
    9790
    This is what i want to do.

    I have a 3 Step form. Which in flow diagram terms is simply 1 -> 2 -> 3.

    All of this is done in one php script called create.php. Below checks that the data entered on step 1 is correct. If it is correct then it should go to step 2. Right now i am using the header.

    The problem with this is that it is refreshing the page and thus I am losing the data that is meant to be saved.

    Do i need to use ajax? Or is there a php method of doing the above.

    PHP Code:
    if ($formerror == TRUE) {
        echo 
    "Error!";

    else

            global 
    $createpageone;
        
    header'Location: create.php?page=2' );        


  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    No, this is possible without AJAX.

    What I do is, I check the value of $_POST['submit']. For instance, the first page the user sees, the text will read something like "Step 2".

    My logic looks something like

    Code:
    // form is submitted
    if (submit button == "some value")
       // get submitted variables (i put mine  into hidden form field elements
      // display second (or n-th) form

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:44 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com