CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Little Help!

  1. #1
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Exclamation Little Help!

    I created a VIP Area and the registration folder contains 3 pages, each page has labels or fields if you wanna say, the problem is that i only got the last page infos, yet the first n' second one i dont receive its infos if someone's registered on it,

    i used the method of POST, $_POST

    For example :

    (PAGE 1)
    PHP Code:
    <input name="firstname" maxlength="20" size="20" class="form-input" type="text" validate="required:true , number:true" /> 
    (PAGE 2)
    PHP Code:
    <?
    $FirstName .= $_POST['firstname'];
    ?>

    <form  method="POST" action="PAGE3.php">
    <input type="hidden" name="firstname" value="<?php echo($FirstName); ?>">
    (PAGE3)
    the same again with page 3 fields

    PHP Code:
    <?
    $FirstName .= $_POST['firstname'];
    ?>

    <form  method="POST" action="PAGE3.php">
    <input type="hidden" name="firstname" value="<?php echo($FirstName); ?>">
    Finally I got only the Page3 Posted fields, non of Page1 or Page2 been recieved at all, it comes empty

    PHP Code:
    $message .= "First Name: ".$_POST['firstname']."\n"
    Please help me to fix this..
    Last edited by PeejAvery; May 17th, 2011 at 11:58 AM. Reason: Added php tags

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Little Help!

    First off, unless you have short php tag turned on in your configuration file, your <? ... ?> is not even going to be interpreted. Always use <?php ... ?>.

    Second, there is no validate attribute for the <input> tag.

    Third, you should not be using .= unless you're concatenating variables. In your example, you're just creating them. So just set them as equal.

    Last, why do you have page 3 redirecting to page 3 again?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Re: Little Help!

    Well I guess you didn't understand because I didn't put the whole source code, wait for me i'll upload it for ya

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Little Help!

    Yes, I did understand. And I replied by helping you correct some code. Apparently you did not understand.

    Also, why are you using echo like you do? Here's the proper way...

    PHP Code:
    <?php echo 'Text to be outputted'// notice no parenthesis ?>
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Jan 2011
    Location
    Morocco
    Posts
    17

    Re: Little Help!

    Well I'm sorry then
    I'm just asking if there's a good way to get Forms result in 3 pages or even 4 pages, i mean each page contains a form and when u go to the next step which is page 2 you will find another form and the same thing with the next steps until u finish them, you must receive the full results of that forms. the question is what methods is good and easy to make it u got me now?

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: Little Help!

    Use sessions to carry data across multiple sessions...not back to back forms.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured