Consider the following code and let me know how to play with the global post in the PHP. Although I have run this code by duplicating the code at two places I need to access the already written code.
I have a file abc.php
:
if (isset($_POST['test'])) {
return 'hello test1';
} elseif(isset($_POST['test2'])){
return 'hello test2';
} else {
return "test3";
}
Now I have another file efg.php
:
if (isset($_GET['hello'])) {
//Here, I need content from abc.php
}
/* More code... */
How do I pass the POST from one page to another?