html - How to get php variable from an action form and use it in the form thats activating the action -


i have 2 files here test first 1 below , when click submit suppose action on next page want know how retrieve athe $life variable action php file , put in normal html file

<!doctype html> <html>   <head>     <meta charset="utf-8">     <title></title>   </head>   <body> <form class="" action="../logic/profileaction.php" method="post"> <label for=""></label>   <button type="submit" name="button">submit</button> </form>   </body> </html> 

second file php file:

<?php $life ="yo";  ?> 

check code. need run code in server

<!doctype html> <html>   <head>     <meta charset="utf-8">     <title></title>   </head>   <body>   <?php   include_once 'edit.php';   echo $life;   ?>  <form class="" action="../logic/profileaction.php" method="post"> <label for=""></label>   <button type="submit" name="button">submit</button> </form>   </body> </html> 

and include edit.php

<?php $life = 'ok'; ?> 

then first file show ok when run code


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -