简体   繁体   English

如何使用PHP在我的地址中组合多个函数?

[英]How can I combine multiple functions in my address using PHP?

I have created two different functions that work from the address bar. 我创建了两个不同的功能,从地址栏工作。 Now I need to combine them. 现在我需要将它们结合起来。 The first I'm passing on a variable. 第一个我传递变量。

http://address.com/mimowg.php?g1

I need to add this after this. 我需要在此之后添加它。 In Python it's a + ; Python中它是+ ; what is it in PHP ? 什么是PHP

?scd=/net/mfg-scd8/et3mach/status.txt

What is the best way to combine these two statements to one working address? 将这两个语句组合到一个工作地址的最佳方法是什么?

使用&符号( & )向您的URL添加多个GET参数。

http://address.com/mimowg.php?g1&scd=/net/mfg-scd8/et3mach/status.txt

要在GET请求中使用多个参数,请使用&组合它们。

http://address.com/mimowg.php?g1&?scd=/net/mfg-scd8/et3mach/status.txt

Your terminology is a little convoluted. 你的术语有点复杂。 But it sounds like you are asking to provide multiple GET parameters to the URL. 但听起来你要求为URL提供多个GET参数。 This is the same whether it's php or python or for anything using http. 无论是php还是python,还是使用http的任何东西都是一样的。

You separate multiple parameters using an & . 您使用&分隔多个参数。 The first parameter follows a ? 第一个参数跟随?

So your url would be something like 所以你的网址会是这样的

http://address.com/mimowg.php?g1&scd=/net/mfg-scd8/et3mach/status.txt

Although it's better to either name both parameters or leave them both unnamed like: 虽然最好为这两个参数命名,或者保留它们两个未命名的参数:

http://address.com/mimowg.php?p1=g1&scd=/net/mfg-scd8/et3mach/status.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM