Solved

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

Posted on 2007-12-04
7
170 Views
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

0
Comment
Question by:alicca
  • 4
  • 3
7 Comments
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
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.
0
 
LVL 2

Author Comment

by:alicca
Comment Utility
Thanks but can u state it clearly? am understand what u talking about. can u give example?
0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Well, the code snippet I gave was the example. Are you using PHP at all?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Author Comment

by:alicca
Comment Utility
yes, but not really pro on php..

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

Author Comment

by:alicca
Comment Utility
can plz give me a example of code of

index.php
page2.php

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

Author Comment

by:alicca
Comment Utility
this 500 of solution point gona be yours :)
0
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
Comment Utility
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now