How to pass Text that inserted on Text Field to the Text field on other page?

Posted on 2007-12-04
Last Modified: 2010-04-16
There is 2 page of html. 1st one is is index.html
let say the Text Field like

                            <input name="stock" type="text" id="password2" size="1" />
                             <input name="password22" type="text" id="password22" size="1" />
                             <input name="password23" type="text" id="password23" size="1" />

For Example i input : WWW2
i wish it could be apper on Text Field on page2.html when i hint summit button on index.html

any one has a good idea? Thanks for you help.. please reply me Urgent :)

Open in new window

Question by:alicca
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 36

Expert Comment

ID: 20407353
Say you are trying to put whatever is in the stock field into page 2. Use PHP (so either name the page .php and run it on a PHP compatible server or configure your server to parse .html as PHP), and you would then just do something like:

<input type="text" value="<?php echo $_POST['stock']; ?>" />

in page 2. Of course, change $_POST to $_GET if your form method is get, but otherwise, that is the general gist.

Author Comment

ID: 20407451
Thanks but can u state it clearly? am understand what u talking about. can u give example?
LVL 36

Expert Comment

ID: 20407465
Well, the code snippet I gave was the example. Are you using PHP at all?
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.


Author Comment

ID: 20407522
yes, but not really pro on php..

did i need to declear where am get the POST from? in page2

Author Comment

ID: 20407532
can plz give me a example of code of


so that would be easy
thanks man i would be very appreciate your help

Author Comment

ID: 20407538
this 500 of solution point gona be yours :)
LVL 36

Accepted Solution

Zyloch earned 500 total points
ID: 20407545
When the user submits your form in index, it should have its action set to page 2. It will pass the form variables in the $_POST or $_GET array (depending on your form method), and you can access them in page 2 that way.

This means in page 2, anywhere in your HTML code (in this case inside the value attribute of your text field), you can insert <?php echo $_POST['NAME']; ?> where you replace NAME with the name of the form field in index that you want to copy.

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question