How to pass parameters between two different scripts?

WBOY
Release: 2016-07-06 13:52:08
Original
965 people have browsed it

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>
Copy after login

or

<code>//php

if ( !empty($_POST['test']) && (int) $_POST['test'] === 1) {
    return $a;
}
</code>
Copy after login

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

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!