Jump to content

Recommended Posts

How can I achieve this: page 1 has a form with textfield1, after clicking submit, page 2 is loaded with another form that also contains textfield1.

Can the data that is entered in textfield1 on page 1 automatically be put in textfield1 on page 2?

I'm sure it can, I just don't know how ::)

 

Link to comment
https://forums.phpfreaks.com/topic/62645-transport-form-data-to-next-page/
Share on other sites

Have you configured PHP ?

 

 

page1.php

<form name="page1" action="page2.php" method="post">

     <input type="text" name="textfeild1" value="testvalue">

    <input type="submit" name="submit" value="submit">

</form>

 

 

page2.php

 

<?php

$textfeild1 = $_POST['textfeild1'];

?>

<form name="page2" action="page3.php" method="post">

     <input type="text" name="textfeild1" value="<?php echo $textfeild1;?>">

    <input type="submit" name="submit" value="submit">

</form>

 

 

optimized...

 

page1.php

<form name="page1" action="page2.php" method="post">
    <input type="text" name="textfield1" value="">
    <input type="submit" name="submit" value="SUBMIT">
</form>

 

page2.php

<form name="page2" action="page3.php" method="post">
    <input type="text" name="textfield1" value="<?=$_POST['textfield1']?>">
    <input type="submit" name="submit" value="submit">
</form>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.