-1

am fresh to coding, so please advice if i had done any mistake.

I am having 2 pages, one am using to input the value and the other need to display the value.i had created the input page with one text box and submit button, once i click submit button the text box content should go to the next page and display the value.

this is the second page where values should come and display enter image description here

This is the first page am entering values

enter image description here, in this i had add one submit button

Kindly help and advice thanks in advance

jyosh
  • 1

2 Answers2

0

you can use session in php to do it, in the first php file:

session_start();
$_SESSION['var']=yourValue;

now in the second php file:

session_start();
echo $_SESSION['var'];
Hicham Zouarhi
  • 1,030
  • 1
  • 18
  • 28
0

First write your form with with get method like

<form method="get" action="second.php">
  <input name="text_field_name1" value=""/>
  <input name="text_field_name2" value=""/>
</form>

than you form value pass second page with url.

You can get value from second page by echo $_GET['text_field_name1']; and echo $_GET['text_field_name2'];

Jakir Hossain
  • 2,457
  • 18
  • 23