I have two different pages. I need to pass stored 2 variables to another page & when a second page will redirect me back to first page, insert back the variables. Thank you!
you can use session variables: session_start(); $_SESSION['var1'] = $var1; $_SESSION['var2'] = $var2; those variables will be available on any page as long as the session is started. Or you can use get variables: page.php?var1=something&var2=somethingelse which would then be visible via: $_GET['var1'] and $_GET['var2'] respectively
both methods given will work - but using get to pass values is pretty silly from a security perspective.
Page1 : <?php session_start(); $_SESSION['yourvariable1'] = $yourvalue1; $_SESSION['yourvariable2'] = $yourvalue2; ?> PHP: Page2 : <?php session_start(); $variable1 = $_SESSION['yourvariable1']; echo $variable1; ?> PHP: