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 7056217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:50:28+00:00 2026-05-28T03:50:28+00:00

In index.php, I have created a form and in the action attribute of the

  • 0

In index.php, I have created a form and in the action attribute of the form tag I have specified “page2.php”.

page2.php is also a form, (which continues on from index.php) and in the action attribute of the form tage I have specified “page3.php”. I can retrieve what the user entered into the “location” text box, in the form on index.php and display it in page2.php through the method
<?php echo $_GET["location"]; ?>

but, I now also want to display the user location in page3.php, but when I use the above method it does not work. It give me the error: “Undefined index: location”. I take it is because page3.php can not access the fields from index.php, but how do I get this to work?

Thanks in advance

  • 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-05-28T03:50:29+00:00Added an answer on May 28, 2026 at 3:50 am

    You will need to store the value of $_GET[“location”]; in a hidden field on page2.php within the form that gets submitted to page3.php.

    Update Example

    page2.php

    <form action="page3.php">
        <input type="hidden" value="<?php print $_GET['location']; ?>" name="location_from_page2" />
    

    page3.php

    $location = $_GET["location_from_page2"];
    

    What you’re doing here is printing out the contents of location into the value of a hidden field and then you’re reading this hidden field in page3.php

    This is one way to do it but you might want to consider looking into the php sessions.

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

Sidebar

Related Questions

I have a index.php file which loads (require) 2 different files based on a
I have a script which returns 5 columns from a php result. I am
I have the follwing code <form enctype="multipart/form-data" action="upload.php" method="POST"> Please choose a file: <input
Files index.php <form name=postform action=post.php method=post enctype=multipart/form-data> <table class=postarea id=postarea> <tbody> <tr> <td class=postblock>Date:</td><td><input
In my index/index action, I'm calling a form class that I created, and output
This is the structure index.php app/processor.php app/.htaccess in the index.php I have this form
i have the following search form <?php echo $this->Form->create('Order', array('action' => 'search','type'=>'get'));?> <?php echo
i have two files:(localhost/template/) index.php template.php each time when i create an article(an article
I have a page index.php where i have a link called add_users.php. In add_users.php,
Assume that I have 2 .php files : index.php and ajax.php This is index.php:

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.