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 7 of 7
  1. #1
    Senior Member
    Join Date
    Apr 2003
    Location
    Las Vegas
    Posts
    231
    Member #
    1169
    I want to have my form auto populate a HTML page upon submission, im doing this for a application that I want to be printed out once they fill out the info on the form. Is there a simple way to do this? Im guessing it can be done with PHP but I dont know where to start, thanks for any help

  2.  

  3. #2
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Sure, let's say that you set up a form with two fields, "input name" and "email_address", set up to use the POST method and to run a PHP script.

    Within the PHP script you can output the entered values using the _POST array... like this...

    Code:
    <table>
      <tr>
        <td>Name:</td>
        <td><?php echo $_POST['input_name']; ?>
      </tr>
      <tr>
        <td>E-mail:</td>
        <td><?php echo $_POST['email_address']; ?>
      </tr>
    </table>
    HTH

    Sean

  4. #3
    Senior Member
    Join Date
    Apr 2003
    Location
    Las Vegas
    Posts
    231
    Member #
    1169
    Ok sounds simple enough, how should I setup the beginning of my form? Should it be something like this?

    Code:
    <form action="mypage.php" method="post">
    Or should it be something else? Anything else I should know? Thanks for the help

    Have any working examples of this form population I can view?

  5. #4
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Quote Originally Posted by Mimic
    Ok sounds simple enough, how should I setup the beginning of my form? Should it be something like this?

    Code:
    <form action="mypage.php" method="post">
    Yes, exactly. If you used the "get" method then your variables would be $_GET['fieldname'] in the php script, but I'd be inclined to use post if I were you...

    Sean

  6. #5
    Senior Member
    Join Date
    Apr 2003
    Location
    Las Vegas
    Posts
    231
    Member #
    1169
    Thanks for the help, I got everything working perfectly now

  7. #6
    Senior Member
    Join Date
    Aug 2003
    Posts
    444
    Member #
    2801
    PLEASE PLEASE PLEASE make sure you check the data that's submitted. When a user submits data to your server, it's a security risk. Check everything that's submitted.
    eKstreme
    eKstreme.com - Free website tools!
    fontfox - free fonts Hand-picked quality fonts.

  8. #7
    Senior Member
    Join Date
    Apr 2003
    Location
    Las Vegas
    Posts
    231
    Member #
    1169
    Never mind I figured it out :devious:


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 05:35 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com