Home >Backend Development >PHP Tutorial >How to pass parameters between two different scripts?

How to pass parameters between two different scripts?

WBOY
WBOYOriginal
2016-07-06 13:52:08989browse

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? ?

Reply content:

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn