Home >Backend Development >PHP Tutorial >How to pass parameters between two different scripts?
To put it simply, I have two links for mobile terminals to interact with
1. http://www.a.com/index.php?test=1
2. http://www.a.com/index.php?testTwo=1
The first link post result will get a $a and $b
But only $a is the data for the mobile terminal, and $b is additional data, but the second link requires the variable result of $b
The current requirement is that the mobile terminal does not need to store $b before posting to me, but I can save it until I continue to post the second link for the second time
This variable cannot be saved in the database, nor can it be used in session. It seems that global cannot be used. What should I do now? ?
To put it simply, I have two links for mobile terminals to interact with
1. http://www.a.com/index.php?test=1
2. http://www.a.com/index.php?testTwo=1
The first link post result will get a $a and $b
But only $a is the data for the mobile terminal, and $b is additional data, but the second link requires the variable result of $b
The current requirement is that the mobile terminal does not need to store $b before posting to me, but I can save it until I continue to post the second link for the second time
This variable cannot be saved in the database, nor can it be used in session. It seems that global cannot be used. What should I do now? ?
I don’t understand what you are saying,
<code>http://www.a.com/index.php?testTwo=1&test=1 ???</code>
or
<code>//php if ( !empty($_POST['test']) && (int) $_POST['test'] === 1) { return $a; } </code>
The author can add the $b result to the second link and pass it as a parameter, for example: http://www.a.com/index.php?testTwo=1&b=
.$b