Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:58:16+00:00 2026-06-13T17:58:16+00:00

I have this simple form. a.php <html> <head> </head> <body> <? echo <form action

  • 0

I have this simple form.

a.php

<html>
<head>
</head>
<body>
    <?

    echo "
        <form action = 'a2.php' method = 'post'>
            <input type = 'text' name = 'name'>
            <input type = 'submit' value = 'SEND' name = 'send'>
        </form>
    ";

    ?>
</body>
</html>

a2.php

<?

$name = $_REQUEST ['name'];
echo $name;

    echo "
    <form action = 'a2.php' method = 'post'>
        <input type = 'submit' value = 'EDIT' name = 'edit'>
     </form>
    ";

?>

How can I keep the value introduced when I click EDIT and i’m back to the first form?
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:58:17+00:00Added an answer on June 13, 2026 at 5:58 pm

    EDIT 2: using hidden inputs
    on a2.php just put another <input type="hidden" name="hidden_name" value="{$_POST['name']}" /> after you hit submit on a2.php (BTW for it to go back to a.php, you need to change the form action="a.php" on a2.php), a.php will have a $_POST['hidden_name'], that will contain the value from the first iteration.

    EDIT: before you start handling $_SESSION variables, first initiate the session before any html output with a session_start() function.

    Use a superglobal like $_SESSION so in your case you would need to fetch the incoming in a2.php $_SESSION['name'] = $_POST['name'] and refer to the $_SESSION['name'] in your a.php. Remember that $_SESSION['name'] will retain the last assigned value until the the session is terminated, I.e. browser window is closed.

    You can read more in http://www.php.net/manual/en/reserved.variables.session.php
    Also about session_start: http://www.php.net/manual/en/function.session-start.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form like this: <form name=serachForm method=post action=/home/search> <input type=text name=searchText
I have a simple form like this : <form method=post name=change_pass id=change_pass action=change_pass2.php> <input
I have a simple form like this one: <form ENCTYPE=multipart/form-data action=upload.php method=POST> <p>UPLOAD FILE:
Actually I have this piece of HTML code <form method=POST action=dosomething.php> <fieldset> <legend>My account</legend>
I have the following code sample upload3.php: <html> <head> <title>PHP Form Upload</title> </head> <body>
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I have simple form like this which accepts only two values string action and
I have a simple html form that is structured something like this: <form name=test
I have this jQuery simple code: <script type=text/javascript> <!-- jQuery(function(){ jQuery('#old_thumb').click(function(){ $(this).val($(this).attr('title')); $('#sf').val('2'); $('#add_new_event').submit();
I wanna make a post form in code behind. I have simple html post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.