如何在页面加载时在URL中获取参数并使其可用于页面(使用Wordpress)

时间:2022-06-25 21:12:11

Is there a simple way to:

有一个简单的方法:

1) Grab parameters in the URL 2) add them to URLS in the page

1)抓取URL中的参数2)将它们添加到页面中的URLS

Example:

http://marianarodrigues.com.br/testewordpress/?var1=123&var2=abc

And Then I need to add these "123" and "abc" values to the end of a few hyperlinks that will be in the same page...

然后我需要将这些“123”和“abc”值添加到将在同一页面中的几个超链接的末尾...

Hyperlink example: www.link1.com.br/?transaction_id=321&partnerid=123&clickid=abc

超链接示例:www.link1.com.br/?transaction_id=321&partnerid=123&clickid=abc

Note: I'd appreciate if somebody could send me something for dummies as I don't have much knowledge =)

注意:我很感激,如果有人可以给我一些傻瓜的东西,因为我没有太多的知识=)

1 个解决方案

#1


See if this get's you pointed in the right direction.

看看这是否指向了正确的方向。

$partnerid = $_GET('var1');
$clickid = $_GET('var2');

$URL = 'http://www.link1.com.br/?transaction_id=321&partnerid=$partnerid&clickid=$clickid';

#1


See if this get's you pointed in the right direction.

看看这是否指向了正确的方向。

$partnerid = $_GET('var1');
$clickid = $_GET('var2');

$URL = 'http://www.link1.com.br/?transaction_id=321&partnerid=$partnerid&clickid=$clickid';