Computing.Net > Forums > Web Development > 2 page forms

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

2 page forms

Reply to Message Icon

Name: Lucy Lu
Date: February 11, 2009 at 06:05:14 Pacific
OS: Windows XP
Subcategory: Javascript/Ajax
Comment:

I am trying to create a form with email address on homepage, click continue and have email pre-populated on screen 2 where the entire form resides?



Sponsored Link
Ads by Google

Response Number 1
Name: shutat
Date: February 13, 2009 at 12:22:18 Pacific
Reply:

Not sure if it's what you're asking, but here's a brief php example that *may* help. Post the code for what you're trying to do and someone will probably be able to offer more detail.

<?php

   if(isset($_POST["cmd"]) && $_POST["cmd"] === "Continue") {

      $email = $_POST["email"];
      echo "<form action='" . $_SERVER["PHP_SELF"] . "' method='post'>" .
        "Name <input name='name' type='text' maxlength='20'>" .
        "email <input name='email' value='$email' type='text' maxlength='20'>" .
        "<input name='cmd' value='submit' type='submit'>" . "</form>";
   } else if(isset($_POST["cmd"]) && $_POST["cmd"] === "submit") {

      print_r($_POST);      
   } else {
?>
<form action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
Email <input name="email" type="text" maxlength="20">
<input name="cmd" value="Continue" type="submit">
</form>
<?php
   }
?>

HTH


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: 2 page forms

Front page Form Help www.computing.net/answers/webdevel/front-page-form-help/1467.html

How i create 3 page with field form www.computing.net/answers/webdevel/how-i-create-3-page-with-field-form/2234.html

Send me 3 page with form field ? www.computing.net/answers/webdevel/send-me-3-page-with-form-field-/2235.html